/**
 * 存储工具：https://github.com/marcuswestin/store.js
 */
import store from 'store'

//默认的token有效期为 25 分钟
let TOKEN_TIMEOUT = 25*60*1000

let server = "server"
let token = "token"
let token_time = "tokenTime"

let _time = ()=> new Date().getTime()

let S = {
    TIMEOUT:24*60*60*1000,  //默认缓存过期时限为一天

    set (k,v){
        return store.set(k,v)
    },
    get (k,dv){
        let v = store.get(k)
        return v===undefined||v===null?dv:v
    },
    instance:store,
}

window.S = window.S || S
export default S